package com.wen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wen.pojo.PurchaseOrder;
import com.wen.pojo.dto.PurchaseOrderDto;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import com.wen.pojo.dto.wen.PurchaseOrderDto;
import com.wen.pojo.dto.wen.PurchaseOrderRKDto;
import com.wen.pojo.dto.wen.PurchaseOrders;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;


public interface PurchaseOrderMapper extends BaseMapper<PurchaseOrder> {


    @Select("SELECT ps.* FROM purchase_order ps INNER JOIN supplier s  WHERE ps.supplier_id=s.supplier_id AND ps.supplier_id=${id}")
    List<PurchaseOrder>  PurByIds(Long id);

    @Update("UPDATE `purchase_order` SET `convey_tag`='p001-3' WHERE `purchase_order_number`=#{id}")
    boolean purUp(String id);


    Page<PurchaseOrders> sel(Page page , @Param("dto") PurchaseOrderDto dto);

    @Update("update purchase_order set check_tag = #{checkTag} where purchase_id = #{id}")
    Boolean up(@Param("checkTag") String checkTag,@Param("id")String id);

    Page<PurchaseOrders> selCheckTag(Page page,@Param("dto") PurchaseOrderDto dto);

    List<PurchaseOrderRKDto> selRK(@Param("id") String id);


}
